// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import BaseUI from "../BaseUI";

const { ccclass, property } = cc._decorator;

@ccclass
export default class WebUI extends cc.Component {
    @property(cc.WebView)
    webview: cc.WebView = null;
    @property(cc.Label)
    titleTxt: cc.Label = null;


    showUI(titleStr: string, url: string) {
        this.titleTxt.string = titleStr;
        this.webview.url = url;
        this.node.active = true;
    }

    closeClick() {
        this.node.active = false;
    }
}
